//
//  NoMessageView.m
//  WideHelp
//
//  Created by ENERGY on 2018/8/27.
//  Copyright © 2018年 ENERGY. All rights reserved.
//

#import "NoMessageView.h"

@implementation NoMessageView
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
//        self.alpha = 0;
        UIView * bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
        bgView.backgroundColor = [UIColor whiteColor];
        [self addSubview:bgView];
        
        UIImageView * imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 96/WIDTH_6_SCALE, 66/WIDTH_6_SCALE)];
        imageView.center = CGPointMake(self.centerX, self.centerY);
        imageView.image = [UIImage imageNamed:@"images_icon"];
        [self addSubview:imageView];
        
        UILabel * titleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, imageView.bottom + 13/WIDTH_6_SCALE, SCREEN_WIDTH, 14/WIDTH_6_SCALE)];
        titleLab.text = @"还没有任何消息……";
        titleLab.font = DEF_FontSize_14;
        titleLab.textColor = [UIColor blackColor];
        titleLab.textAlignment = NSTextAlignmentCenter;
        [self addSubview:titleLab];
    }return self;
}
- (void)showView{
    [[UIApplication sharedApplication].delegate.window addSubview:self];
    [UIView animateWithDuration:.15 animations:^{
        self.alpha = 1;
    }];
}
@end
